a_tartan - a Microsoft Windows tartan generator Version 1.0 Copyright 1992 James Patrick Russell. All Rights Reserved. Antrim Software Cellar Jim Russell, prop. 27 Freeman Place Nutley NJ 07110 USA CIS [71620,3061] ILink - JIM RUSSELL (WinAppDev conference host) Purpose: This WinApp will generate a small "swatch" of tartan bitmap, which can be used as tiled wallpaper in Microsoft Windows (v3.0 and later). It was written solely for my own amusement, and I am distributing it as "freeware" for anyone to freely use and enjoy. I ask only for feedback and maybe some pattern description's of YOUR clan's tartan. As this is basically a "toy" application, don't expect long-winded docs explaining what Windows wallpaper is, or for that matter, what tartans are. If someone else knows enough to expand this little note, feel free. Send me a copy, and it'll go into the next revision. What's here: a_tartan.exe The program. Goes wherever you keep WinApps. a_tartan.ini Sample tartan patterns from my family tree (Russell and Ross). Put this in your Windows directory (the one that has WIN.INI in it). a_tartan.txt What you're reading right now. What's not here, but you need: vbrun100.dll The Visual Basic runtime library, available virtually anywhere you download files. Since it is expected that a large proportion of Windows freeware/shareware will be written in Visual Basic, there is an unwritten rule that it not be included in everybody's archives. Pick it up separately and save download time! Tartan Theory: This whole application came about when I wore my Russell tartan tie to work one day. While waiting for my ILink mail transfer to download, I began examining the tie, and noticed that the cross-hatch pattern of the threads looked a lot like pixels in a bitmap. In fact, the areas where the black threads were going horizontal and the green threads were going vertical looked exactly like a dithered color. I also noticed that the pattern of a tartan is regularly repeating -- hmmm, just like tiled wall- paper! If I could only describe the way it repeats, I could generate a small bitmap, and tile it, and have my Windows wallpaper be the Russell tartan. That's exactly what I did. I broke down the description like so: 1 255 255 255 15 0 0 255 2 255 0 0 15 0 0 0 15 0 128 0 1 0 0 0 The first number of each line is the number of threads for a certain color. The other three numbers are the red, green and blue values for that color, ranging from 0 to 255. This is the "standard" way of describing colors in Windows. So what we have above is: a. 1 white thread b. 15 blue threads c. 2 red threads d. 15 black threads e. 15 dark green threads f. 1 black thread Now, this only describes part of the tartan, but the rest of it is all mirror images of this description. In other words, in order to have a "swatch" of tartan that would tile correctly, the threads would be "woven" like this: a b c d e f f e d c b a a b c d e f f e d c b a Now, since that time, I've examined quite a few other tartans, and it seems that they all follow this "mirror" pattern. If there are some that are not symmetrical like this, please contact me and let me know about them. Also, please note from the description above that the edges of the "tile" pattern were described with 1 thread, even though, when you look at the tartan, there are 2 threads. This is, of course, because they will be butting up against another copy of the bitmap in the tile (in the case of thread "a"), or against the "mirror" (in the case of thread "f"). Clear as mud? Then, I got into a discussion on the ILink network with an actual Scotsman, a Mr. Sandy Blair from Glasgow. He brought up something I had not thought about -- the weave. I wrote "a_tartan" assuming that all tartans were woven the way that tie was -- one thread up, one thread down, making the whole pattern look somewhat like a checkerboard. He showed me some other weaves that were used, and they may be implemented in future versions. For now, I stuck with the checkerboard weave. A note on colors -- even though I used the RGB description for colors, which allows for 256 values for each of red, green and blue, a_tartan v1.0 only draws in 16 colors. This is a limitation of Visual Basic, so until I port this application to Borland C++, that's what we've got to work with. If you're not really, really picky as far as shades are concerned, you should be able to describe your tartan using the 16. Which, by the way, are: 255 255 255 white 0 0 0 black 255 0 0 red 0 255 0 green 0 0 255 blue 128 0 0 dark red (kind of maroon-y) 0 128 0 dark green (a forest green, useful in tartans) 0 0 128 dark blue (almost purple) 255 255 0 yellow 255 0 255 magenta 0 255 255 cyan (sky blue) 128 128 0 brown (copper/gold shade) 128 0 128 dark magenta 0 128 128 dark cyan (sky blue on a miserable day) 128 128 128 dark grey 192 192 192 light grey Running the program: If, by any chance, you've understood any of my ramblings above, and have figured out how to describe your family's tartan, the actual running of "a_tartan" is easy. Run the program (under Windows, of course). You'll see a superbly designed main window. Press the "About..." button to display my name. Ahhh, thank you. Freeware authors live for things like that. You can press the "Ok" button to get back to the main window any time now. Alright, let's take the areas of the main window one at a time: Clan: The "name" of the tartan, usually the family or clan name. This is a combo-box -- you can press the little arrow to pick from any previously described tartans saved in the .INI file, or type in a new name. Pattern: This is where you type in a pattern consisting of lines of four numbers (number of threads, red, green, blue) as I tried to describe above. Don't leave any blank lines in between. Pixels per thread: Defaults to one. I put this in because on a high-resolution monitor, you might want to have "bigger" threads, of two or three pixels. It's here, and it works, but it's pretty slow. If you've got WinGif, or something similar, you might want to generate your bitmap at 1 pixel/thread, and use WinGif to enlarge it. "Generate" button: Generates the bitmap. Once pressed, this changes to a "Cancel" button, which stops the drawing. By the way, you can minimize a_tartan while it's generating if you want. "Save BMP" button: Once generated, you will want to save the bitmap to a .BMP file, for later wallpaper use. I was very lazy here - I make you type in the file name, and didn't use any of the little directory windows and stuff you're probably used to seeing in WinApps. Maybe when Windows v3.1 comes out, I'll use their "common file dialog" box. "About" button: Go ahead, press it again. Tartan drawn here: Tartan drawn here. Contacting the author: The best way to get in touch with me is on the ILink bulletin board network -- I host the Windows Application Development conference (WinAppDev), and also lurk around in Basic, C-Lang, Programming, RockAndRoll, and a few other places. You can also reach me on CompuServe as [71620,3061], or by writing a real letter (my address is at the top of this file). Let me know about any bugs, anomalies, or anything else about "a_tartan". And send me some more tartan descriptions! Enjoy! Jim Russell 16 Jan 1992 ----------------end-of-author's-documentation--------------- Software Library Information: This disk copy provided as a service of Public (software) Library We are not the authors of this program, nor are we associated with the author in any way other than as a distributor of the program in accordance with the author's terms of distribution. Please direct shareware payments and specific questions about this program to the author of the program, whose name appears elsewhere in this documentation. If you have trouble getting in touch with the author, we will do whatever we can to help you with your questions. All programs have been tested and do run. To report problems, please use the form that is in the file PROBLEM.DOC on many of our disks or in other written for- mat with screen printouts, if possible. PsL cannot debug pro- programs over the telephone, though we can answer questions. Disks in the PsL are updated monthly, so if you did not get this disk directly from the PsL, you should be aware that the files in this set may no longer be the current versions. Also, if you got this disk from another vendor and are having prob- lems, be aware that some files may have become corrupted or lost by that vendor. Get a current, working disk from PsL. For a copy of the latest monthly software library newsletter and a list of the 4,000+ disks in the library, call or write Public (software) Library P.O.Box 35705 - F Houston, TX 77235-5705 Orders only: 1-800-2424-PSL MC/Visa/AmEx/Discover Outside of U.S. or in Texas or for general information, Call 1-713-524-6394